<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('查看小程序授权信息')"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-shopApplet-edit" class="form-horizontal" th:object="${authInfo}">
        <input type="hidden" id="appId" th:value="${appId}">
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-10">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>小程序名称：</label>
                    <div class="col-sm-6">
                        <input class="form-control" th:value="*{nickName}" disabled>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-10">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>小程序头像：</label>
                    <div class="col-sm-6">
                        <img th:src="*{headImg}" style="max-width: 50px;max-height: 50px;">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-10">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1"
                                              aria-expanded="true">RequestDomain</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-2"
                                        aria-expanded="false">WsRequestDomain</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">UploadDomain</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">DownloadDomain</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="panel-body">
                                <p th:each="domain1 : *{miniProgramInfo.network.requestDomain}"
                                   th:text="${domain1}"></p>
                            </div>
                        </div>
                        <div id="tab-2" class="tab-pane">
                            <div class="panel-body">
                                <p th:each="domain2 : *{miniProgramInfo.network.wsRequestDomain}"
                                   th:text="${domain2}"></p>
                            </div>
                        </div>
                        <div id="tab-3" class="tab-pane">
                            <div class="panel-body">
                                <p th:each="domain3 : *{miniProgramInfo.network.uploadDomain}"
                                   th:text="${domain3}"></p>
                            </div>
                        </div>
                        <div id="tab-4" class="tab-pane">
                            <div class="panel-body">
                                <p th:each="domain4 : *{MiniProgramInfo.network.downloadDomain}"
                                   th:text="${domain4}"></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-10">
                <div class="form-group">
                    <label class="col-sm-4 control-label"></label>
                    <div class="col-sm-6">
                        <div class="input-group">
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-success" onclick="autoModifyDomain()">域名自动配置</button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script>

    function autoModifyDomain() {
        let appId = $('#appId').val();
        $.modal.confirm("正在进行自动配置域名，请确认？", function () {
            $.operate.save(ctx + "back/wechatOpen/autoSetDomain", {appletAppId:appId});
        });
    }
</script>
</body>
</html>